In cognitive Orthogonal Frequency Division Multiplexing (OFDM) systems, to avoid interference to Primary Users (PU), the transmission power of Cognitive Users (CU) need to be controlled and allocated. Since the transmission power can not be allocated legitimately and the data transmission rate can not be improved effectively, a power allocation algorithm of double factor binary search optimization was proposed on the basis of traditional water-filling power allocation algorithm. In the presented algorithm, the interference temperature limit on the cognitive user channel was taken into account. Firstly, a surplus function was introduced under the total power constraints. Secondly, because of the monotonicity of the surplus function, the accurate values of Lagrangian multipliers could be attained through the double binary search iteration method. Finally, the power allocation of the sub-channels was conducted through the values of Lagrangian multipliers. The simulation results show that the proposed algorithm can effectively use the spectrum hole between primary users. The data transmission rate of the cognitive users can be maximized under both total power constraints and Interference Temperature (IT) constraints. The data transmission rate is approaching to the traditional water-filling algorithm. Compared with the total power average control algorithm and the interference temperature average control algorithm, the data transmission rate of the presented algorithm is obvious higher, which exceeds about 4×105b/s under the same circumstance. Moreover, the algorithm has less processing time and reflects a good robustness.